home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM 1
/
LIGHT-ROM 1 (Amiga Library Services)(1994).iso
/
ffdisks
/
d879.lha
/
Millim
/
Millim.doc
next >
Wrap
Text File
|
1993-05-12
|
6KB
|
119 lines
The file "millim.ps" contains PostScript procedures that draw
millimetered paper with logarithmic or linear scales both on x and y;
the user should write a PostScript program that calls these routines.
To do this, save millim.ps and edit a copy of that same file; go
to the end, and replace all the instructions between the lines saying
"%%Page 1 1" and "%%Trailer". Be careful: THE CASE IS SIGNIFICANT in
PostScript!
- The first line must be "init" (do NOT write the " quotes).
- The default paper size is A4; if you are using Letter sized paper,
insert here a single line saying "letter"; if you are using custom
paper, insert here two lines defining the paper size, like the
following examples (obey to the case and the spacing!). You can use
as units inches, centimeters or millimeters simply typing "in" or
"cm" or "mm"; if no unit is given the default is a "point", i.e.
1/72th of an inch:
/xsheet 8.5 in def
/ysheet 297 mm def
/xsheet 612 def
("xsheet" and "ysheet" are the names of the variables holding the
paper sizes; these statements store into them the correct values).
- The default page orientation is portrait; if you need landscape
orientation, insert here a single line saying "landscape".
- Then insert (optional) lines to modify the default values of every
constant that do not satisfy your needs; these constants with their
default values are:
/margin 2 cm def
/fontsize 10 def
/bordersize 1 def
/linesize 0.4 def
/smallsize 0.01 def
/bordergray 0 def
/linegray 0 def
/smallgray 0 def
and their meaning is the following:
. "margin": the drawing is done in a rectangular region at "margin"
from the paper borders. Be sure that the axis labels can fit in
"margin" (these labels are ALWAYS printed).
. "fontsize" is the height (in points) of the font (Times-Roman) used
to print the axis labels.
. "bordersize", "linesize" and "smallsize" are the width in points of
the lines used to draw the frame borders, the normal divisions and
the small subdivisions (see later for the definitions of the last
two). Note that the default smallsize is 0.01 points, or 1/7200 of
an inch; lines defined as narrower than the printer resolution, will
be printed at the printer resolution: so that, on a 300dpi printer,
also the default small lines will be 1/300th of an inch wides.
. "bordergray", "linegray" and "smallgray" are the gray levels of
these same lines: they must be values from 0 to 1 inclusive, 0
meaning black and 1 meaning white (i.e. not drawn). Be careful: on
some printers "gray" lines are rendered as dotted lines; or, "gray"
and very thin lines could or could not be drawn according to their
position on the page.
- Then define two arrays, "xscale" and "yscale", in the following way:
/xscale [-2 2] def OR
/xscale [0 1 10] def OR
/xscale [0 2 10 4] def
(the difference between these three variants is the number of
arguments inside the square brackets; the same works for yscale).
. With two arguments, the x/y scale is logarithmic; and the arguments
themselves are the powers of ten of the beginning and the end of
these scales: [-2 2] means from 10^-2 to 10^2.
. With three arguments, the scale is linear; the first and last
arguments are the minimum and maximum value, and the middle one is
the width of the axis intervals where a label and a "normal
division" line will be inserted: [0 1 10] means from 0 to 10 with
labels and divisions every unit.
. With four arguments, the scale is still linear; the meaning of the
first 3 arguments remains the same, and the fourth one is the number
of sub-intervals in every "normal division": for every one of these
sub-intervals, a line is drawn but no label is printed. [0 2 10 4]
means: lower value 0, and higher value 10; labels and normal lines
every 2 units and each one of these 2 units normal intervals further
divided in 4 sub-intervals.
- Then, insert a statement saying "drawsheet", to perform the drawing.
- Then, insert a statement saying "showpage", to print the drawing;
optionally, if you are proficient in PostScript, you can overimpose
graphs on the drawing before the "showpage" command.
- Print the file on a PostScript printer.
If you want to print more than 1 page, put at the end of the file
more than a single sequence of commands, from init to showpage. To be
completely consistent with the PostScript programming language, you
could also edit the statement "%%Pages: 1" in line 5, substituting to
"1" the actual number of pages; and put statements like "%%Page 2 2"
before every new printed sheet (i.e. between every showpage and the
next init). But this may not be actually needed, because most printers
do not really care about these statements.
-----
Enjoy!
The file millim.ps with its content is public domain, and can be
spread and modified as you want.
Comments and modifications are gladly accepted via EMail to
loreti@padova.infn.it
MLO
-----
Maurizio Loreti (MLO) - Ham: I3NOO
Work: University of Padova, Department of Physics
Via F. Marzolo, 8 - 35131 Padova - Italy
DECnet: VAXFPD::LORETI, i.e. 39330::LORETI
BITNET: LORETI@IPDINFN
INTERNET: loreti@padova.infn.it
BIX: mloreti